import {useAxios} from '@/hooks/web/useAxios'

const request = useAxios()

//患者列表
export const listPatient = (params) => {
    params.dataType = "TJ02"
    return request.get({
        url: '/system/patient/list/patVisit',
        params
    })
}

//患者报告
export const reportData = (activeName: string, params) => {
    let url = ''
    switch (activeName) {
        case '1'://体温
            url = '/system/reports/tj02/temperature'
            break
        case '2':
            url = '/system/reports/tj02/spO2'
            break
        case '3':
            url = '/system/reports/tj02/heartRate'
            break
    }
    return request.get({
        url,
        params
    })
}

//医生下诊断
export const visitt = (data: { visitNo: string | undefined; diagnosis: string }) => {
    return request.post({
        url: '/system/patient/doDiagnosis',
        data
    })
}

//患者报告
export const appletReportData = (activeName: string, params) => {
    let url = ''
    switch (activeName) {
        case '1':
            url = '/applet/bracelet/report/temperature'
            break
        case '2':
            url = '/applet/bracelet/report/spo2'
            break
        case '3':
            url = '/applet/bracelet/report/heart'
            break
    }
    return request.get({
        url,
        params
    })
}

